﻿<?php  
require_once("BaseDao.php");
require_once("Doc.php");


class KBDao extends BaseDao {

	

	public function findall() {
		$sth = $this->db->prepare("select * from k_biao");
		$sth->execute();
		//print_r($sth->errorInfo());
		$array = array();
		while($row = $sth->fetch(PDO::FETCH_ASSOC)){
			$doc = new Doc($row['id'],$row['week'],$row['onek'], $row['twok'], $row['thrk'], $row['fouk'], $row['fivk'],$row['sixk'], $row['sevk']);
			$array[] = $doc;
		}
		return $array;
	}

	public function upda($one,$two,$thirk,$si,$wu,$liu,$qi,$week) {
			$sth = $this->db->prepare("UPDATE `k_biao` SET  onek=:one, twok=:two, thrk=:thirk, fouk=:si, fivk =:wu, sixk=:liu, sevk=:qi WHERE week = :week");
			
			$sth->bindValue(':one', $one, PDO::PARAM_STR);
			$sth->bindValue(':two', $two, PDO::PARAM_STR);
			$sth->bindValue(':thirk', $thirk, PDO::PARAM_STR);
			$sth->bindValue(':si', $si, PDO::PARAM_STR);
			$sth->bindValue(':wu', $wu, PDO::PARAM_STR);
			$sth->bindValue(':liu', $liu, PDO::PARAM_STR);
			$sth->bindValue(':qi', $qi, PDO::PARAM_STR);
			$sth->bindValue(':week', $week, PDO::PARAM_INT);
			$sth->execute();
			print_r($sth->errorInfo());
		}
	
}

//$kbdao = new KBDao();
//$dao1=$dao->findall();
//for($i=0;$i<3;$i++){
	//print_r($kbdao->upda("wooda人","a","a","a","a","a","a",2));
	
//}*/

	
?>